﻿<div id="Modal-General">
    @model Alabama.Models.ChangePasswordModel
@{
    ViewBag.Title = "Đổi mật khẩu";
}
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('input[name="OldPassword"]').focus();
        });
    </script>
    <div class="modal-header">
        <button class="close" data-dismiss="modal">
            ×</button><h3>@ViewBag.Title</h3>
    </div>
    <div class="modal-body">
        @using (Ajax.BeginForm("ChangePassword", "Account", null, new AjaxOptions
        {
            UpdateTargetId = "ModalGeneral",
            HttpMethod = "Post",
            InsertionMode = InsertionMode.Replace,
        }, new { Class = "form-horizontal well", @style = "margin-bottom: 0px;" }))
        {
            <p class="alert alert-info fade in" style="margin: 0 0 10px; position: relative;">
                Mật khẩu yêu cầu tối thiểu 6 kí tự. <a class="close" data-dismiss="alert" style="top: 5px;
                    position: absolute; right: 10px;">×</a>
            </p>
            @Html.ValidationSummary(true, "Đổi mật khẩu thất bại. Vui lòng kiểm tra và thử lại.")
            <div class="control-group formSep">
                <label class="control-label">
                    Mật khẩu cũ <span class="f_req">*</span></label>
                <div class="controls">
                    @Html.PasswordFor(m => m.OldPassword, new { Class = "focus" })
                    <span class="help-block">@Html.ValidationMessageFor(m => m.OldPassword)</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    Mật khẩu mới <span class="f_req">*</span></label>
                <div class="controls">
                    @Html.PasswordFor(m => m.NewPassword, new { Class = "" })
                    <span class="help-block">@Html.ValidationMessageFor(m => m.NewPassword)</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    Nhắc lại mật khẩu <span class="f_req">*</span></label>
                <div class="controls">
                    @Html.PasswordFor(m => m.ConfirmPassword, new { Class = "" })
                    <span class="help-block">@Html.ValidationMessageFor(m => m.ConfirmPassword)</span>
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <input class="btn btn-info" type="submit" value="Đổi mật khẩu" />
                    <a class="btn" data-dismiss="modal">Huỷ</a>
                </div>
            </div>
        }
    </div>
</div>
